package org.boot.easyapi.enums.permission;

import lombok.Getter;

@Getter
public enum TypeEnum {

    PATH("PATH_KEY", "路径规则"),
    IP("IP_KEY", "ip规则");

    private String key;
    private String note;

    TypeEnum(String key, String note) {
        this.key = key;
        this.note = note;
    }

    public static TypeEnum getByCode(Integer key) {
        for (TypeEnum value : TypeEnum.values()) {
            if (value.key.equals(key)) {
                return value;
            }
        }
        return null;
    }


}
